package gestionTransportObjetsGenerated;

/**
 * Interface definition : GestionOperateur
 * 
 * @author OpenORB Compiler
 */
public class _GestionOperateurStub extends org.omg.CORBA.portable.ObjectImpl
        implements GestionOperateur
{
    static final String[] _ids_list =
    {
        "IDL:gestionTransportObjetsGenerated/GestionOperateur:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = gestionTransportObjetsGenerated.GestionOperateurOperations.class;

    /**
     * Read accessor for nom attribute
     * @return the attribute value
     */
    public String nom()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_nom",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_nom",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    return _self.nom();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation informerBesoinTransport
     */
    public void informerBesoinTransport(gestionTransportObjetsGenerated.TransportColis colis)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("informerBesoinTransport",true);
                    gestionTransportObjetsGenerated.TransportColisHelper.write(_output,colis);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("informerBesoinTransport",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    _self.informerBesoinTransport( colis);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation accepterTransport
     */
    public String accepterTransport(gestionTransportObjetsGenerated.TransportColis colis)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("accepterTransport",true);
                    gestionTransportObjetsGenerated.TransportColisHelper.write(_output,colis);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("accepterTransport",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    return _self.accepterTransport( colis);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation verifierCodeTransport
     */
    public gestionTransportObjetsGenerated.TransportColis verifierCodeTransport(String codeTransp)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("verifierCodeTransport",true);
                    _output.write_string(codeTransp);
                    _input = this._invoke(_output);
                    gestionTransportObjetsGenerated.TransportColis _arg_ret = gestionTransportObjetsGenerated.TransportColisHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("verifierCodeTransport",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    return _self.verifierCodeTransport( codeTransp);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation notifierDepotTransp
     */
    public void notifierDepotTransp(gestionTransportObjetsGenerated.TransportColis colis)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("notifierDepotTransp",false);
                    gestionTransportObjetsGenerated.TransportColisHelper.write(_output,colis);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("notifierDepotTransp",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    _self.notifierDepotTransp( colis);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation obtenirStations
     */
    public void obtenirStations(String numEnv, gestionTransportObjetsGenerated.TransportColisHolder colis)
        throws gestionTransportObjetsGenerated.COLIS_INCONNU
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("obtenirStations",true);
                    _output.write_string(numEnv);
                    _input = this._invoke(_output);
                    colis.value = gestionTransportObjetsGenerated.TransportColisHelper.read(_input);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(gestionTransportObjetsGenerated.COLIS_INCONNUHelper.id()))
                    {
                        throw gestionTransportObjetsGenerated.COLIS_INCONNUHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("obtenirStations",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionOperateurOperations _self = (gestionTransportObjetsGenerated.GestionOperateurOperations) _so.servant;
                try
                {
                    _self.obtenirStations( numEnv,  colis);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
